Skip to content

chore: Release 1.0.2 - #17

Merged
fadi-george merged 6 commits into
mainfrom
rel/1.0.2
May 8, 2026
Merged

chore: Release 1.0.2#17
fadi-george merged 6 commits into
mainfrom
rel/1.0.2

Conversation

@fadi-george

Copy link
Copy Markdown
Contributor

Channels: Current

🐛 Bug Fixes

@fadi-george
fadi-george requested a review from a team May 8, 2026 20:16
@fadi-george
fadi-george merged commit e8fa806 into main May 8, 2026
7 checks passed
@fadi-george
fadi-george deleted the rel/1.0.2 branch May 8, 2026 20:16

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release PR with version bumps, regenerated docs, a CI permission addition, and mirrored example refactors — the only finding is a nit in an example app's debug log.

Extended reasoning...

Overview

This is the 1.0.2 release PR. The substantive changes are:

  • Version bumps in three places: OneSignalWrapper.sdkVersion from 010000010002 in both the Android and iOS plugins, and package.json from 1.0.11.0.2.
  • A regenerated README.md (purely docgen output churn — table separators changed from --- to --------------------, blank-line and comment-formatting differences). No API surface changes.
  • A one-line CI addition in .github/workflows/cd.yml granting pull-requests: read, with an inline note that it is required by a transitively-called github-release.yml workflow.
  • Mirrored refactors in examples/demo/src/hooks/useOneSignal.ts and examples/demo_pods/src/hooks/useOneSignal.ts that switch pushSubHandler from an async Promise.all of getters to using the PushSubscriptionChangedState event payload directly, plus matching commented-out delay blocks.

Security risks

None. The CI workflow change only adds a read-only pull-requests scope inside an existing permissions: block; it does not broaden write capabilities, and the job is already gated on pull_request.merged == true and a chore: Release title prefix. No auth/crypto/permission code in the plugin itself is touched. The example-app changes are not part of the published package (files in package.json excludes examples/).

Level of scrutiny

Low. This is a release-cut PR — the SDK behavior changes referenced in the description (#13 and #15) landed in prior PRs, so this PR is essentially a version stamp plus example/docs polish. The Android/iOS plugin code shown in the modified files is the post-#13 lifecycle/dedupe state, with the only change in this PR being the sdkVersion literal bump.

Other factors

The bug hunting system flagged a single nit: examples/demo_pods/src/hooks/useOneSignal.ts is missing a console.log(Permission changed: ${granted}) line that was added to the parallel examples/demo/src/hooks/useOneSignal.ts. The two demos are clearly intended to mirror each other in this PR, and every other handler is byte-identical, so this is an obvious oversight — but it only affects developer-facing log output in an unpublished example app and has zero impact on plugin behavior, the npm package, or end users. Approving despite the nit; the inline comment already records it for follow-up.

Comment on lines 213 to 214

const permissionHandler = (granted: boolean) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Nit / pre-existing-style oversight: examples/demo/src/hooks/useOneSignal.ts adds console.log(\Permission changed: ${granted}`)insidepermissionHandler, but the matching change was not made in examples/demo_pods/src/hooks/useOneSignal.tsat lines 213-215. The two example apps mirror each other in this PR (both received identicalpushSubHandler` refactors and identical 'Uncomment if you want…' comment blocks), so the missing log line in demo_pods looks like an oversight rather than intentional. No functional impact — only affects example-app debug output.

Extended reasoning...

What the bug is

This PR makes a series of parallel changes to two example apps that are clearly meant to mirror each other: examples/demo/src/hooks/useOneSignal.ts and examples/demo_pods/src/hooks/useOneSignal.ts. In both files the PR rewrites pushSubHandler byte-identically (the same fmtToken helper, the same template literal, the same destructuring of previous/current) and adds the same 'Uncomment if you want so you have time to see logs while trying to open safari web inspector' comment block at the top of load(). However, the demo file also gets a new console.log(\Permission changed: ${granted}`)line insidepermissionHandler`, while demo_pods does not.

The specific code path

In examples/demo/src/hooks/useOneSignal.ts (around the changed lines), the handler now reads:

const permissionHandler = (granted: boolean) => {
  console.log(`Permission changed: ${granted}`);
  setHasNotificationPermission(granted);
};

In examples/demo_pods/src/hooks/useOneSignal.ts at lines 213-215, the same handler instead reads:

const permissionHandler = (granted: boolean) => {
  setHasNotificationPermission(granted);
};

Both handlers are wired up via OneSignal.Notifications.addEventListener('permissionChange', permissionHandler) later in the same effect, and the surrounding handlers (pushSubHandler, userChangeHandler, handleNotificationClick, handleForegroundWillDisplay, the IAM listeners) all have matching console.log calls in both files.

Why existing code doesn't prevent it

These are example apps, not part of the published SDK. There is no shared module between the two demos and no test that asserts they stay in sync, so a forgotten line in one of them passes lint, type-check, and CI.

Impact

Negligible at runtime — the missing log line only changes what the developer sees in the JS console while exercising demo_pods. It does not affect plugin behavior, packaged output, or end users in any way. This is purely a consistency/debugging-ergonomics nit.

Step-by-step proof

  1. Open examples/demo/src/hooks/useOneSignal.ts and find permissionHandler — it has two statements: a console.log and a state setter.
  2. Open examples/demo_pods/src/hooks/useOneSignal.ts and find permissionHandler at lines 213-215 — it has only the state setter.
  3. Compare the surrounding handlers in both files: pushSubHandler is byte-identical, including the exact Push subscription changed: id=… log message. userChangeHandler is byte-identical, including the User changed: onesignalId=… log. The IAM willDisplay/didDisplay/willDismiss/didDismiss/click handlers are all byte-identical with their console.log calls. Even the load() comment about Safari web inspector is byte-identical.
  4. Conclusion: the two files are intentionally kept in lockstep in this PR, but permissionHandler is the single divergence — a missed parallel edit.

How to fix

Add the same line to examples/demo_pods/src/hooks/useOneSignal.ts so its permissionHandler reads:

const permissionHandler = (granted: boolean) => {
  console.log(`Permission changed: ${granted}`);
  setHasNotificationPermission(granted);
};

One-line fix, no risk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant